<h2 class="subtitle">Password</h2>

<%= form_for @changeset, Routes.user_path(@conn, :update_password), [as: :account], fn f -> %>
  <%= if Map.has_key?(@changeset.params, "reset_token") do %>
    <%= hidden_input f, :reset_token %>
  <% else %>
    <div class="field">
      <%= label f, :old_password, class: "label" %>
      <div class="control">
        <%= password_input f, :old_password, class: "input", required: true %>
      </div>
      <%= error_tag f, :old_password %>
    </div>
  <% end %>

  <div class="field">
    <%= label f, :password, "New Password", class: "label" %>
    <div class="control">
      <%= password_input f, :password, class: "input" %>
    </div>
    <%= error_tag f, :password %>
  </div>

  <hr />

  <div class="field">
    <%= submit "Update password", class: "button is-link" %>
  </div>
<% end %>
